#include<main.h>


int Sort_General_up(const void* p1, const void* p2)
{
	const STUDENT* a = (const STUDENT*)p1;
	const STUDENT* b = (const STUDENT*)p2;
	int value = 0;
	if (a->General > b->General)
	{
		value = -1;
	}
	else if (a->General == b->General)
	{
		value = 0;
	}
	else if (a->General < b->General)
	{
		value = 1;
	}
	return value;
}

int Sort_General_down(const void* p1, const void* p2)
{
	const STUDENT* a = (const STUDENT*)p1;
	const STUDENT* b = (const STUDENT*)p2;
	int value = 0;
	if (a->General > b->General)
	{
		value = 1;
	}
	else if (a->General == b->General)
	{
		value = 0;
	}
	else if (a->General < b->General)
	{
		value = -1;
	}
	return value;
}

int Sort_ID_down(const void* p1, const void* p2)
{
	const STUDENT* a = (const STUDENT*)p1;
	const STUDENT* b = (const STUDENT*)p2;
	int value = 0;
	if (a->ID > b->ID)
	{
		value = 1;
	}
	else if (a->ID == b->ID)
	{
		value = 0;
	}
	else if (a->ID < b->ID)
	{
		value = -1;
	}
	return value;
}

int Sort_Name(const void* p1, const void* p2)
{
	const STUDENT* a = (const STUDENT*)p1;
	const STUDENT* b = (const STUDENT*)p2;
	int value = 0;
	if (a->Name[0] > b->Name[0])
	{
		value = 1;
	}
	else if (a->Name[0] == b->Name[0])
	{
		value = 0;
	}
	else if (a->Name[0] < b->Name[0])
	{
		value = -1;
	}
	return value;
}



